﻿
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>大学生信贷管理系统</title>
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <!-- basic styles -->
    <link href="~/Content/bootstrap.min.css" rel="stylesheet" />
    <link href="~/Content/css/font-awesome.min.css" rel="stylesheet" />
    <!-- ace styles -->
    <link href="~/Content/css/ace.min.css" rel="stylesheet" />
    <link href="~/Content/css/ace-rtl.min.css" rel="stylesheet" />
    <link href="~/Content/css/ace-skins.min.css" rel="stylesheet" />
    <link href="~/Content/themes/bootstrap/easyui.css" rel="stylesheet" />
    <link href="~/Content/themes/icon.css" rel="stylesheet" />
    <script src="~/Scripts/jquery-1.11.3.min.js"></script>
    <script src="~/Scripts/jquery.easyui-1.4.5.min.js"></script>
    <script src="~/Scripts/json2.min.js"></script>
    <script src="~/Scripts/bootstrap.min.js"></script>
    <script src="~/Scripts/typeahead-bs2.min.js"></script>
    <!-- page specific plugin scripts -->
    <!--[if lte IE 8]>
      <script src="~/Scripts/excanvas.min.js"></script>
    <![endif]-->
    <script src="~/Scripts/jquery-ui-1.10.3.custom.min.js"></script>
    <script src="~/Scripts/jquery.ui.touch-punch.min.js"></script>
    <script src="~/Scripts/jquery.slimscroll.min.js"></script>
    <script src="~/Scripts/jquery.sparkline.min.js"></script>
    <script src="~/Scripts/flot/jquery.flot.min.js"></script>
    <script src="~/Scripts/flot/jquery.flot.pie.min.js"></script>
    <script src="~/Scripts/flot/jquery.flot.resize.min.js"></script>
    <!-- ace scripts -->
    <script src="~/Scripts/ace-elements.min.js"></script>
    <script src="~/Scripts/ace.min.js"></script>
    <!------->
    <!--[if lte IE 8]>
      <link rel="stylesheet" href="assets/css/ace-ie.min.css" />
    <![endif]-->
    <!-- inline styles related to this page -->
    <!-- ace settings handler -->
    <style type="text/css">
        .menu-text {
            height: auto;
            line-height: normal;
            float: none;
            padding-left: 0;
        }
    </style>
    <script src="~/Scripts/ace-extra.min.js"></script>
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="~/Scripts/html5shiv.js"></script>
    <script src="~/Scripts/respond.min.js"></script>
    <![endif]-->
    <script type="text/javascript">
        try {
            ace.settings.check('navbar', 'fixed');
            ace.settings.check('main-container', 'fixed');
            ace.settings.check('sidebar', 'fixed');
            ace.settings.check('sidebar', 'collapsed');
        } catch (e) { }
    </script>
    <script>
        $(function () {
            $.ajax({
                type: 'post',
                url: '/Shared/_Layout',
                async: true,
                dataType: 'json',
                success: function (data) {
                    $("#count").html(data.length);
                    $("#msgCount").html(data.length + "条数据");

                    for (var i = 0; i < data.length; i++) {
                        if (i < 3) {
                            var a = '<a href="#">';
                            a += ' <img src="http://localhost:12470/assets/avatars/avatar.png" id="msgsubmituser" class="msg- photo" alt=" " />';
                            a += '&nbsp;&nbsp;&nbsp;&nbsp;<span  class="msg- body"><span class="msg-title"> <span class="blue" id="submitUser">' + data[i].SubmitUser + ':</span> <p id="question1" style="width:100px; white-space:nowrap; text-overflow:ellipsis; overflow:hidden;">' + data[i].Questions + '</p></span><span class="msg-time"> <i class="icon-time"></i> <span id="submitDate1">' + data[i].SubmitDate + '</span></span> ';
                            a += "</span></a>";
                            $("#li").append(a);
                        }
                    }
                }
            });

        });
    </script>

</head>
<body>
    <div class="navbar navbar-default" id="navbar">
        <div class="navbar-container" id="navbar-container">
            <div class="navbar-header pull-left">
                <a href="#" class="navbar-brand">
                    <small>
                        <i class="icon-leaf"></i>
                        大学生信贷管理系统
                    </small>
                </a>
                <!-- /.brand -->
            </div>
            <!-- /.navbar-header -->

            <div class="navbar-header pull-right" role="navigation">
                <ul class="nav ace-nav">
                    <li class="green">
                        <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                            <i class="icon-envelope icon-animated-vertical"></i>
                            <span class="badge badge-success" id="count"></span>
                        </a>
                        <ul class="pull-right dropdown-navbar dropdown-menu dropdown-caret dropdown-close">
                            <li class="dropdown-header">
                                <i class="icon-envelope-alt" id="msgCount"></i>
                            </li>

                            <li id="li">

                            </li>


                            <li>
                               
                                <a href="">
                                    查看所有消息
                                    <i class="icon-arrow-right"></i>
                                </a>
                            </li>
                        </ul>
                    </li>

                    <li class="light-blue">
                        <a data-toggle="dropdown" href="#" class="dropdown-toggle">
                            <span class="user-info">
                                <small>你好,</small>
                                @ViewBag.UserName
                            </span>

                            <i class="icon-caret-down"></i>
                        </a>

                        <ul class="user-menu pull-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
                            <li>
                                <a href="#" onclick="Change();">
                                    <i class="icon-cog"></i> 修改密码
                                </a>
                            </li>

                            <li>
                                <a href="#" onclick="Self();">
                                    <i class="icon-user"></i> 个人资料
                                </a>
                            </li>

                            <li class="divider"></li>

                            <li>
                                <a href=@Url.Action("exit","Home")>
                                    <i class="icon-off"></i> 退出
                                </a>
                            </li>
                        </ul>
                    </li>
                </ul>
                <!-- /.ace-nav -->
            </div>
            <!-- /.navbar-header -->
        </div>
        <!-- /.container -->
    </div>
    <div class="main-container" id="main-container">
        <div class="main-container-inner">
            <a class="menu-toggler" id="menu-toggler" href="#">
                <span class="menu-text"></span>
            </a>

            <div class="sidebar" id="sidebar">
                <div class="sidebar-shortcuts" id="sidebar-shortcuts">
                    <div class="sidebar-shortcuts-mini" id="sidebar-shortcuts-mini">
                        <span class="btn btn-success"></span>
                        <span class="btn btn-info"></span>
                        <span class="btn btn-warning"></span>
                        <span class="btn btn-danger"></span>
                    </div>
                </div>
                <!-- #sidebar-shortcuts -->
                <ul class="nav nav-list">
                    <li id="admin_li" class="">
                        @*<a href=@Url.Action("admin","Adminuser") target="iform">*@
                        <a href="" target="iform">
                            <i class="icon-user"></i>
                            <span class="menu-text"> 通知管理</span>
                        </a>
                    </li>
                    <li id="business_li">
                        @*<a href=@Url.Action("enterprise","Businessuser")>*@
                        <a href="">
                            <i class="icon-group"></i>
                            <span class="menu-text">贷款学生管理</span>
                        </a>
                    </li>
                    <li id="type_li">
                        @*<a href=@Url.Action("ProductType","ProductType")>*@
                        <a href="">
                            <i class="icon-puzzle-piece"></i>
                            <span class="menu-text">贷款类型管理 </span>
                        </a>
                    </li>
                    <li id="info_li">
                        @*<a href=@Url.Action("ShowProductInfo","ProductInfo")>*@
                        <a href="">
                            <i class="icon-inbox"></i>
                            <span class="menu-text"> 贷款信息管理 </span>
                        </a>
                    </li>
                    <li id="appoint_li">
                        @*<a href=@Url.Action("Question","Question")>*@
                        <a href="">
                            <i class="icon-calendar"></i>
                            <span class="menu-text"> 用户管理 </span>
                        </a>
                    </li>

                </ul>
                <!-- /.nav-list -->
                <div class="sidebar-collapse" id="sidebar-collapse">
                    <i class="icon-double-angle-left" data-icon1="icon-double-angle-left" data-icon2="icon-double-angle-right"></i>
                </div>
            </div>
            <div class="main-content">
                <div class="page-content">

                    @RenderBody()


                </div>
            </div>
        </div>
        <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
            <i class="icon-double-angle-up icon-only bigger-110"></i>
        </a>
    </div>
    <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
        <i class="icon-double-angle-up icon-only bigger-110"></i>
    </a>


    <!--修改密码的弹窗-->
    <div id="dd" class="easyui-dialog" data-options="closed:true" modal="true" shadow="false" style="padding:5px;width:300px;height:200px;display:none;" title="修改密码" iconCls="icon-ok">
        <form id="ChangePwd" method="post" action="/Home/ChangePwd">
            <table>
                <tr>
                    <td>账号:</td>
                    <td><input name="UserAccount" id="UserAccount" type="text" disabled="true" value="@ViewBag.UserAccount" /></td>
                </tr>
                <tr>
                    <td>旧密码:</td>
                    <td><input class="easyui-validatebox" id="OldUserPassword" name="OldUserPassword" type="password" required="true" validType="email" missingMessage="旧密码不能为空" invalidMessage="请正确输入旧密码"></input></td>
                </tr>
                <tr>
                    <td>新密码：</td>
                    <td><input class="easyui-validatebox" name="NewUserPassword" id="NewUserPassword" type="password" required="true" missingMessage="新密码不能为空" invalidMessage="新密码无效请重新输入"></input></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input type="button" onclick="text();" value="提交" />&nbsp;&nbsp;&nbsp;<input type="button" onclick="" value="重置" /></td>
                </tr>
            </table>
        </form>
    </div>

    @*个人资料弹框*@
    <div id="self" class="easyui-dialog" data-options="closed:true" modal="true" shadow="false" style="padding:5px;width:300px;height:300px;display:none;" title="个人资料" iconCls="icon-ok">
        <form id="" method="post">
            <table>
                <tr>
                    <td>用户Id:</td>
                    <td><input name="UserAccount" id="UserAccount" type="text" value="@ViewBag.UserID" readonly="readonly" /></td>
                </tr>
                <tr>
                    <td>账号:</td>
                    <td><input name="UserAccount" id="UserAccount" type="text" value="@ViewBag.UserAccount" readonly="readonly" /></td>
                </tr>
                <tr>
                    <td>密码:</td>
                    <td><input value="@ViewBag.UserPassword" type="text" readonly="readonly" /></td>
                </tr>
                <tr>
                    <td>用户名：</td>
                    <td><input value="@ViewBag.UserName" type="text" readonly="readonly" /></td>
                </tr>
                <tr>
                    <td>最后修改时间：</td>
                    <td><input value="@ViewBag.LastModifyDate" type="text" readonly="readonly" /></td>
                </tr>
                <tr>
                    <td>最后修改人：</td>
                    <td><input value="@ViewBag.LastModifyUser" type="text" readonly="readonly" /></td>
                </tr>
            </table>
        </form>
    </div>

    <script type="text/javascript">
        //点击按钮弹出弹窗
        function Change() {
            $('#dd').dialog('open').dialog('center');
        }
        function text() {
            var ChangePwd = {
                UserAccount: $("#UserAccount").val(),
                OldUserPassword: $("#OldUserPassword").val(),
                NewUserPassword: $("#NewUserPassword").val(),
            }

            $.ajax({
                type: "POST",
                url: "/Home/ChangePwd",
                data: ChangePwd,
                dataType: "json",
                error: function () {
                    alert("服务器错误！");
                },
                success: function (data) {
                    if (data == 0) {
                        alert("修改密码成功！");
                        $('#dd').dialog('close');

                    } else {
                        alert("修改密码失败！");
                        //清空弹出框（没写）
                    }
                }
            });
        }
        //点击按钮弹出个人资料弹窗
        function Self() {
            $('#self').dialog('open').dialog('center');
        }
    </script>
    <script src="~/Scripts/jquery.easyui-1.4.5.min.js"></script>
</body>
</html>
